#include "Volume.h"
#include "FileManager.h"
#include <stdio.h>
#include <stdlib.h>

int createHelado(volume_t * volume)
{
	int i = 0;
	int j = 0;
	int k = 0;

	for(i=0;i<volume->dim[0];i++)
		for(j=0;j<volume->dim[1];j++)
			for(k=0;k<volume->dim[2];k++)
			{
				if (i % 25)
					volume->data[i][j][k] = 1.0;
				else
					volume->data[i][j][k] = 0.0;
			}
	

	return 0;

}

int main(int argc, char ** argv)
{

	if (argc < 6)
	{
		fprintf(stderr,"CreateVolume TIPO new_name new_x new_y new_z\n TIPO 0 Helado");
		return -1;
	}

	int	tipo 	= atoi(argv[1]);
	hsize_t	dim[3];
		dim[0] 	= atoi(argv[3]);
	  	dim[1] 	= atoi(argv[4]);
	  	dim[2]	= atoi(argv[5]);

        volume_t volume;

	createVolume(&volume, dim);

	if (tipo == 0)
		createHelado(&volume);

	CreateFile(&volume, argv[2], "value", dim[0], dim[1], dim[2]);

	destroyVolume(volume);

	return 0;

}
